/*
 * JVMUtil.java
 * xmlanalysis
 * 2011-10-2
 */
package com.lyjilu.util;

/**
 * @author dawn.lou Copyright (c) 2011-2012, dawn.liu. All rights reserved.
 *         2011-10-2 上午10:32:06
 */
public class JVMUtil {
	public static void main(String[] args) {
		System.out.println("空闲内存："+Runtime.getRuntime().freeMemory()/(1024*1024)+"kb");
		System.out.println(Runtime.getRuntime().maxMemory()/(1024*1024)+"kb");
		System.out.println(Runtime.getRuntime().totalMemory()/(1024*1024)+"kb");
		for(int i = 0;i<10000000;i++){
			String str = "aaaaa"+i;
		}
		System.out.println(Runtime.getRuntime().freeMemory()/(1024*1024)+"kb");
		System.out.println(Runtime.getRuntime().maxMemory()/(1024*1024)+"kb");
		System.out.println(Runtime.getRuntime().totalMemory()/(1024*1024)+"kb");
	}
}
